﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vds2465Telegrams
{
	[TestClass]
	public class UserData_44_History_Test
	{
		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test01_Equals()
		{
			UserData_44_History userData = new UserData_44_History(eHistory.Redirection);

			{
				// completely different type - NOT equal
				object dummyObject = new object();
				Assert.IsFalse(userData.Equals(dummyObject));
			}

			{
				// different derived type 
				UserData_40_Test userData2Compare = new UserData_40_Test();
				Assert.IsFalse(userData.Equals(userData2Compare));
			}

			{
				// same object - equal
				UserData_44_History userData2Compare = new UserData_44_History(userData.History);
				Assert.IsTrue(userData.Equals(userData2Compare));
			}

			{
				// different history
				eHistory history = eHistory.Sent;
				if (userData.History == eHistory.Sent)
				{
					history = eHistory.OperationPanelSwitchOffRedirection;
				}
				UserData_44_History userData2Compare = new UserData_44_History(history);
				Assert.IsFalse(userData.Equals(userData2Compare));
			}			
		}

		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test02_GetHashCode()
		{
			UserData_44_History userData = new UserData_44_History(eHistory.Sent);
			int hashCode01 = userData.GetHashCode();
		}

		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test03_ToString()
		{
			UserData_44_History userData = new UserData_44_History(eHistory.SentFailure);
			string stringResult = userData.ToString();
			Assert.IsNotNull(stringResult);
		}
	}
}
